import httpRequest from '../../utils/request'
import modules from '../modules'
const defaultRoute = 'ProductPlanning_ProductBill'
const controllerName = 'ProductBill'

export interface ProductBillParam {
  ProductBillsName: string | null
  PageIndex: number
  PageSize: number
  totalCount: number
 
}


// 获取产品列表
export function ApiGetProductPlanning_ProductBillPageListAsync(param: ProductBillParam) {
  return httpRequest({
    url: `${modules.ProductPlanningModuleUrl}/${controllerName}/Get${defaultRoute}PageList`,
    method: "Post",
    data: param,
  });
}

// 根据id获取产品列表
export function ApiGetProductPlanning_ProductBillByIdListAsync(param: string) {
  return httpRequest({
    url: `${modules.ProductPlanningModuleUrl}/${controllerName}/Get${defaultRoute}ByIdList`,
    method: "Post",
    data: {
      productBillId:param
    },
  });
}

// 批量删除产品
export function ApiDeletionProductPlanning_ProductBillAsync(param: string[]) {
  return httpRequest({
    url: `${modules.ProductPlanningModuleUrl}/${controllerName}/Deletion${defaultRoute}`,
    method: "Post",
    data: param,
  });
}


// 添加产品
export function ApiCreateProductPlanning_ProductBillAsync(param: object) {
  return httpRequest({
    url: `${modules.ProductPlanningModuleUrl}/${controllerName}/Create${defaultRoute}`,
    method: "Post",
    data: param,
  });
}


// 更新产品
export function ApiUpdateProductPlanning_ProductBillAsync(param: object) {
  return httpRequest({
    url: `${modules.ProductPlanningModuleUrl}/${controllerName}/Update${defaultRoute}`,
    method: "Post",
    data: param,
  });
}

// 添加产品BOM
export function ApiCreateProductPlanning_ProductBillDetialAsync(param: object) {
  return httpRequest({
    url: `${modules.ProductPlanningModuleUrl}/${controllerName}/Create${defaultRoute}Detial`,
    method: "Post",
    data: param,
  });
}

// 修改产品BOM
export function ApiUpdateProductPlanning_ProductBillDetialAsync(param: object) {
  return httpRequest({
    url: `${modules.ProductPlanningModuleUrl}/${controllerName}/Update${defaultRoute}Detial`,
    method: "Post",
    data: param,
  });
}


// 删除产品BOM
export function ApiDeletionProductPlanning_ProductBillDetialAsync(param: object) {
  return httpRequest({
    url: `${modules.ProductPlanningModuleUrl}/${controllerName}/Deletion${defaultRoute}Detial`,
    method: "Post",
    data: param,
  });
}